Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the $$scope key from $$props when calculating spread #2618

Merged
merged 1 commit into from
May 4, 2019
Merged

Remove the $$scope key from $$props when calculating spread #2618

merged 1 commit into from
May 4, 2019

Conversation

EmilTholin
Copy link
Member

This PR makes is so the $$scope property of the $$props object will not be included in a spread update to avoid errors like DOMException: Failed to execute 'setAttribute' on 'Element': '$$scope' is not a valid attribute name.

By setting $$scope as accounted for straight away in get_spread_update it will not be part of the update.

Fixes #2520

@EmilTholin EmilTholin changed the title Remove the 21618scope key from 21618props when calculating spread Remove the $$scope key from $$props when calculating spread Apr 29, 2019
@Rich-Harris Rich-Harris merged commit c217f2b into sveltejs:master May 4, 2019
@Rich-Harris
Copy link
Member

that is a nice fix

@EmilTholin EmilTholin deleted the remove_21618scope_from_spread branch May 4, 2019 09:58
@dancherb
Copy link

I'm still getting this exact error.

const { style, ...passProps } = $$props

Now, $$slots and $$scope are found in passProps and give the following error when passProps is passed to a component:

DOMException: Failed to execute 'setAttribute' on 'Element': '$$slots' is not a valid attribute name

If I try and remove these from passProps like so, I get an error saying $ is reserved and cannot be used for import names;

const { style, $$scope, $$slots, ...passProps } = $$props

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use of $$props in component causing DOMException
3 participants